import React, { useEffect, useState } from 'react'
import { Table, Divider, Tag } from 'antd';
import { http } from '@/lib';
import apis from '@/apis/AboutQuota';

const columns = [
  {
    title: '序号',
    dataIndex: 'name',
    key: 'name',
    width:140,
    render:(text,reoder,index)=>index+1
  },
  {
    title: '物料编码',
    dataIndex: 'prodBarcode',
    key: 'prodBarcode',
    width:140,
  },
  {
    title: '物料描述',
    dataIndex: 'matName',
    key: 'matName',
    width:160,
  },
  {
    title: '期初库存（含未到货）/件',
    key: 'beginningRealStock',
    dataIndex: 'beginningRealStock',
    width:160,
  },
  {
    title: '期间开单/件',
    key: 'nowAog',
    dataIndex: 'nowAog',
    width:140,
  },
  {
    title: '当前实物库存/件',
    key: 'nowRealStock',
    dataIndex: 'nowRealStock',
    width:140,
  },
  {
    title: '当前未到货/件',
    key: 'onOrder',
    dataIndex: 'onOrder',
    width:140,
  },
  {
    title: '期间动销数/件',
    key: 'nowMove',
    dataIndex: 'nowMove',
    width:140,
  },
  {
    title: '下月订单计划/件',
    key: 'nextMonthOrderNum',
    dataIndex: 'nextMonthOrderNum',
    width: 150,
  },
];

const CurrentMonthPinModel = (props) =>{
  const [arrList, setArrList] = useState([])
  useEffect(() => {
    handelgetlist()
  }, [])
  const handelgetlist = () =>{
    let brandCode = props.brandCode
    let dealerCode = props.dealerCode
    let productGroupId = props.groupId
      http.get(apis.getCheckStock,{params:{brandCode,dealerCode,productGroupId}}).then(resp=>{
         setArrList(resp.data.checkStockDetailRespVos)
      })
   }
   return (
      <Table columns={columns} dataSource={arrList} scroll={{ x: '1200px'}}  pagination={false} rowKey="id"/>
   )
}


export default CurrentMonthPinModel